package org.company.venus.dao;

import java.io.Serializable;

import javax.annotation.Resource;

import org.company.venus.bean.User;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class UserDao extends HibernateDaoSupport {
    
    @Resource(name="sessionFactory")
    public void setSuperSessionFactory(SessionFactory sessionFactory) {
        super.setSessionFactory(sessionFactory);
    }
    
    public void save(User user) {
        this.getHibernateTemplate().save(user);
    }
    
    public User get(Serializable id) {
        return this.getHibernateTemplate().get(User.class,id);
    }
    
    public User load(Serializable id) {
        return this.getHibernateTemplate().load(User.class, id);
    }
}
